/**
 * vuex模块化合并，使用时正常使用就行，不需要前边加模块名称；
 * @date 23.2.2
 * @author lxx
 * */
import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);
const files = require.context("./modules", false, /\.js$/);
let modules = {
	state: {},
	mutations: {},
	actions: {},
	getters: {}
};
files.keys().forEach((key) => {
  Object.assign(modules.state, files(key)["state"]);
  Object.assign(modules.mutations, files(key)["mutations"]);
  Object.assign(modules.actions, files(key)["actions"]);
  Object.assign(modules.getters, files(key)["getters"]);
});
const store = new Vuex.Store(modules);
export default store;

